package com.my.interview.lock;

public class MyThread1 implements Runnable{


    private ReentranLockUnfair reentranLockUnfair;

    public MyThread1(ReentranLockUnfair reentranLockUnfair) {
        this.reentranLockUnfair = reentranLockUnfair;
    }

    @Override
    public void run() {

        reentranLockUnfair.lock();
        System.out.println(Thread.currentThread().getName() + "  抢到了锁");
        reentranLockUnfair.run();
        reentranLockUnfair.unlock();
    }
}
